
<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org" >

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>云健康医疗系统</title>
    
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript" src="/js/funs.js"></script>
<link rel="stylesheet" href="/css/bootstrap.min.css">
 <link rel="stylesheet" href="/plugins/bootstraptable/bootstrap-table.min.css">
	<style>
 @charset "utf-8";
 
*{
    margin: 0;
    padding: 0;
}
 
body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: url("https://pic3.zhimg.com/80/v2-0b58b7d909dca8c5e7b186a891e6a42e_1440w.webp") no-repeat;
    background-size: cover;
}
 
.loginForm {
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 350px;
    height: 380px;
    border-top: 1px solid rgba(255,255,255,0.5);
    border-left: 1px solid rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    background: rgba(50,50,50,0.2);
}
 
.loginForm > h2 {
    margin-bottom: 20px;
    color: rgba(0, 0, 0, 0.5);
}
 
.loginForm .form-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    margin-bottom: 10px;
}
 
.loginForm .form-group > label {
    margin-bottom: 5px;
    color: rgba(0,0,0,1);
    font-size: 13px;
}
 
.loginForm .form-group > input {
    box-sizing: border-box;
    color: rgba(0,0,0,1);
    font-size: 14px;
    height: 35px;
    width: 249px;
    background: rgba(255,255,255,0.3);
    border: 1px,solid rgba(255,255,255,0.5);
    border-radius: 0.2s;
    outline: none;
    padding: 0 10px;
    letter-spacing: 1px;
}
 
.loginForm .form-group > input:focus {
    border: 1px,solid rgba(255,255,255,0.8);
}
 
.loginForm .form-group {
    width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
 
}
 
.loginForm .btn-box > a {
    font-size: 13px;
    text-decoration: none;
    color: rgba(255,255,255,0.9);
    transition: 0.2s;
    width: 249px;
    text-align: end;
}
 
.loginForm .btn-box > a:hover {
    color: rgba(255,255,255,1);
}
 
.loginForm .btn-box > div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: start;
}

.loginForm .btn-box > div >button {
    width: 240px;
    height: 35px;
    border: 1px solid rgba(29,29,29,0.5);
    background: rgba(29,29,29,0.5);
    color: rgba(255,255,255,0.9);
    border-radius: 5px;
    transition: 0.2s;
}
 
.loginForm.btn-box>div>button:hover{
    border: 1px solid rgba(29,29,29,0.5);
    background: rgba(29,29,29,0.5);
}
 
.loginForm .btn-box > div >button:nth-of-type(2){
    margin-left: 5px;
}
    </style>
</head>

<body>
	<div class="loginForm">
        <h2>云健康医疗系统</h2>
        <div class="form-group">
			<label for="username">账号：</label>
			<input type="text" id="name" name="name" placeholder="用户名" >
		</div>
 		<div class="form-group">
			<label for="password">密码：</label>
			<input type="password" id="pass" name="pass" placeholder="密码">
		</div><br>
        <div class="dxan">
            <label class="radio-inline">
                <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="0" onclick="pd(0)"> 管理员&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </label>
            <label class="radio-inline">
                <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="1" onclick="pd(1)"> 医生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </label>
            <label class="radio-inline">
                <input type="radio" name="inlineRadioOptions" id="inlineRadio3" value="2" onclick="pd(2)"> 护士
            </label>
        </div><br>
        <div class="btn-box">
            <div>
                <button>登录</button>
            </div>
        </div>
    </div>

   <script type="text/javascript">
   var $;
   var layer;

   layui.use(["jquery","layer"],function(){
	    $=layui.jquery;
	    layer=layui.layer;
	    $("button").click(function(){
	    	var val=-1;
		    if(document.getElementById("inlineRadio1").checked) {
		      val=0;
		    } else if(radioBtn = document.getElementById("inlineRadio2").checked){
		      val=1;
		    } else if(radioBtn = document.getElementById("inlineRadio3").checked){
		   	  val=2;
		    }
		    if(val==0){
	    		var name=$("[name=name]").val();
	    		var pass=$("[name=pass]").val(); 
	    		ajax_post("/User/login",{"name":name,"pass":pass},function(json){
	    			if(json.status>0){
	    				location.href="/index.html";
	    			}else{
	    				openAlert(json.msg); 
	    			}
	    		})
		    }else if(val==1){
		    	var name=$("[name=name]").val();
	    		var pass=$("[name=pass]").val(); 
	    		ajax_post("/Doctor/login",{"name":name,"pass":pass},function(json){
	    			if(json.status>0){
	    				location.href="/index_doctor.html";
	    			}else{
	    				openAlert(json.msg); 
	    			}
	    		})
		    }else if(val==2){
		    	var name=$("[name=name]").val();
	    		var pass=$("[name=pass]").val(); 
	    		ajax_post("/Nurse/login",{"name":name,"pass":pass},function(json){
	    			if(json.status>0){
	    				location.href="/index_nurse.html";
	    			}else{
	    				openAlert(json.msg); 
	    			}
	    		})
		    }
	    })

   })
   </script>
</body>

</html>
